<template>
  <div class="detail">
    <ZgDialog
      :width="view.width"
      :top="view.top"
      :title="view.title"
      :showFooter="false"
      v-model="visible"
      @cancel="cancel"
    >
      <div class="contentTitle fs18 fw8">企业名称</div>
      <div class="top flx">
        <div class="chart"></div>
        <div class="infoList"></div>
      </div>
      <div class="bottom">
        <a-tabs v-model="activeKey">
          <a-tab-pane v-for="tab in tabs" :key="tab.key" :tab="tab.label"></a-tab-pane>
        </a-tabs>
        <template v-if="activeKey === 'matrix'">
          <Matrix />
        </template>
        <template v-else-if="activeKey === 'basicInfo'">
          <BasicInfo />
        </template>
        <template v-else-if="activeKey === 'businessInfo'">
          <BusinessInfo />
        </template>
        <template v-else-if="activeKey === 'businessRisk'">
          <BusinessRisk />
        </template>
        <template v-else-if="activeKey === 'lawRisk'">
          <LawRisk />
        </template>
        <template v-else-if="activeKey === 'knowledge'">
          <Knowledge />
        </template>
        <template v-else-if="activeKey === 'supplyChain'">
          <SupplyChain />
        </template>
        <template v-else-if="activeKey === 'violation'">
          <Violation />
        </template>
      </div>
    </ZgDialog>
  </div>
</template>
<script>
export default {
  props: {
    inputClick: {
      type: Function,
      default: (t) => {}
    }
  },
  data() {
    return {
      visible: false,
      view: {
        width: '80%',
        top: '5%',
        title: '详情'
      },
      obj: null,
      other: {},
      activeKey: 'matrix',
      tabs: [
        { label: '特征矩阵', key: 'matrix' },
        { label: '企业基本信息', key: 'basicInfo' },
        { label: '经营信息', key: 'businessInfo' },
        { label: '经营风险', key: 'businessRisk' },
        { label: '法律风险', key: 'lawRisk' },
        { label: '知识能力', key: 'knowledge' },
        { label: '供应链关系图', key: 'supplyChain' },
        { label: '严重违法', key: 'violation' }
      ]
    }
  },
  components: {
    Matrix: () => import('./components/Matrix.vue'),
    BasicInfo: () => import('./components/BasicInfo.vue'),
    BusinessInfo: () => import('./components/BusinessInfo.vue'),
    BusinessRisk: () => import('./components/BusinessRisk.vue'),
    LawRisk: () => import('./components/LawRisk.vue'),
    Knowledge: () => import('./components/Knowledge.vue'),
    SupplyChain: () => import('./components/SupplyChain.vue'),
    Violation: () => import('./components/Violation.vue')
  },
  mounted() {},
  methods: {
    open(json) {
      this.obj = Object.assign({}, this.obj, json || {})
      console.log('获取的行数据', this.obj)
      this.visible = true
    },
    cancel() {
      this.activeKey = 'matrix'
    }
  }
}
</script>

<style lang="scss" scoped>
.top {
  height: 300px;
  background: #0c8eff07;
  .chart,
  .infoList {
    width: 50%;
  }
}
</style>
